<HTML><HEAD><TITLE>set_flag(+Flag, ++Value)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Development Environment and Global Settings</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>set_flag(+Flag, ++Value)</H1>
Succeeds if the flag Flag is successfully set to the value Value.


<DL>
<DT><EM>Flag</EM></DT>
<DD>Atom.
</DD>
<DT><EM>Value</EM></DT>
<DD>Atomic or compound term.
</DD>
</DL>
<H2>Description</H2>
   Used to set the environment flag Flag to the value Value.  The current
   value of a flag may be returned using get_flag/2.  Refer to the
   specification of get_flag/2 for details about each of the environment
   flags.

<P>

<H3>Modes and Determinism</H3><UL>
<LI>set_flag(+, ++) is det
</UL>
<H3>Modules</H3>
This predicate is sensitive to its module context (tool predicate, see @/2).
<H3>Exceptions</H3>
<DL>
<DT><EM>(4) instantiation fault </EM>
<DD>Flag and/or Value are not instantiated.
<DT><EM>(5) type error </EM>
<DD>Flag is neither an atom nor a variable.
<DT><EM>(5) type error </EM>
<DD>Value is not of the expected type.
<DT><EM>(6) out of range </EM>
<DD>Flag and/or Value are out of range.
<DT><EM>(30) trying to write a read-only flag </EM>
<DD>Flag is a read-only flag.
</DL>
<H2>Examples</H2>
<PRE>
Success:
   set_flag(gc,verbose).
   set_flag(syntax_option, no_blanks).
   set_flag(syntax_option, not nl_in_quotes).


   % The following example will set a new library path

   [eclipse]: get_flag(library_path,Path),
      set_flag(library_path, ["/home/myuser/mylibs" | Path]).

   Path = ["/usr/local/ECLIPSE/lib"]
   yes.

Fail:
   set_flag(statistics, some).

Error:
   set_flag(X,a).                (Error  4)
   set_flag("a",x).              (Error  5)
   set_flag(blah, a).            (Error  6)
   set_flag(gc,fred).            (Error  6)
   set_flag(version,1).          (Error 30)



</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/env/get_flag-2.html">get_flag / 2</A>, <A HREF="../../kernel/env/env-0.html">env / 0</A>, <A HREF="../../kernel/opsys/cd-1.html">cd / 1</A>, <A HREF="../../kernel/compiler/compile-1.html">compile / 1</A>, <A HREF="../../kernel/compiler/compile-2.html">compile / 2</A>, <A HREF="../../kernel/dynamic/dynamic-1.html">dynamic / 1</A>, <A HREF="../../kernel/directives/pragma-1.html">pragma / 1</A>, <A HREF="../../kernel/compiler/lib-1.html">lib / 1</A>
</BODY></HTML>
